<template>
  <div>
    <h1>商品详情</h1>
    <span>{{$route.params.id}}</span><br><br><br>
    <span>{{$route.params.name}}</span><br><br><br>
    <span>{{$route.params.price}}</span>
  </div>
</template>
<script>
export default {
  name: 'productDetail',
  data() {
    return {
      
    };
  },
  created() {
    console.log(`发请求！获取${this.$route.params.name}的数据`)
  },
  components: {
    
  },
  // 组件内前置守卫
  beforeRouteEnter (to, from, next) {
    // ...
    next()
  },
  methods: {
  
    
  },
};
</script>
<style lang="">
  
</style>